import {fgui} from "../../../../../../libs/fairygui.1.3.0";
import BaseFguiVc from "./BaseFguiVc";
import {uiPkgName} from "../../utils/loadUi";

export default class HomeVc extends BaseFguiVc {

    constructor() {
        super();
        this.circle = null;
        this.startGame = null;
        this.challengeBtn = null;
        this.rankingBtn = null;
        this.bestScore = null;
        this.soundSwitch = null;
        if (fgui.UIPackage.getByName(uiPkgName)) {
            this.onLoaded();
        }
    }

    onLoaded() {
        this.initUi(uiPkgName, 'home');
        this.circle = this.getCompByName('circle');
        this.startGame = this.getCompByName('startGame');
        this.challengeBtn = this.getCompByName('challengeBtn');
        this.rankingBtn = this.getCompByName('rankingBtn');
        this.bestScore = this.getCompByName('bestScore');
        this.soundSwitch = this.getCompByName('soundSwitch');
    }

    dispose() {
        super.dispose();
        this.circle = null;
        this.startGame = null;
        this.challengeBtn = null;
        this.rankingBtn = null;
        this.bestScore = null;
        this.soundSwitch = null;
    }
}